<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
	if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('setting');
	$footernav=array(
		array('title'=>'拼车','icon'=>'icon-shouye','action'=>'jy_cmspinche/index/'),
		array('title'=>'带客','icon'=>'icon-kefuyouxian1','action'=>'jy_cmspinche/daike/'),
		array('title'=>'发布','icon'=>'icon-quanbudingdan','action'=>'jy_cmspinche/fabu/'),
		array('title'=>'我的','icon'=>'icon-wode1','action'=>'jy_cmspinche/home/'),
	);
	$hdps =array(
		array('title'=>'首页','image'=>'../addons/jy_cmspinche/img/hdp.jpg'),
	);
	$item['hdps']=$item['hdps']?$item['hdps']:$hdps;
	$item['footernav']=$item['footernav']?:$footernav;
    $return['item']=$item;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'系统设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本参数',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
					array('type'=>'radio','title'=>'是否需要审核','name'=>'shenhe','options'=>'status'),
				)
			),
		
			array(
				'title'=>'幻灯片',
				'list'=>array(
				array('type'=>'array','name'=>'hdps','add_tip'=>'添加一个幻灯片',
				'list'=>array(
					array('type'=>'image','name'=>'image','title'=>'幻灯片'),	
					array('type'=>'string','name'=>'url','title'=>'幻灯片url'),	
				),
				'details'=>array(
					array('type'=>'image','name'=>'image','title'=>'幻灯片'),	
					array('type'=>'link','name'=>'url','from'=>'action','title'=>'幻灯片url'),
				)
				),
				)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$data=array_fields(array('title','logo','hdps','share_title','share_image','share_desc','daohang','price','shenhe','footernav'),$postdata);
	$item=$this->plugin_setting('setting',$data);
	exi('设置成功');
}
?>